package model.trader.trade;

import java.util.ArrayList;
import java.util.List;

import model.market.MarketInformation;
import model.market.MarketManager;
import model.market.Position;
import model.market.Trade;
import model.trader.TradeInstruction;
import model.trader.Trader;

public class ImmediateExecutionStrategy implements TradeExecutionStrategy{

	public java.util.List<Trade> trade(Trader trader,Position pos,
			TradeInstruction[] instructions, MarketManager market,MarketInformation marketInfo) {
		java.util.List<Trade> ret = new ArrayList<Trade>();
		for(int i=0;i<instructions.length;i++){
			TradeInstruction tradeInstruction = instructions[i];
			Trade trade=new Trade(trader,i,
					tradeInstruction.getNumberToTrade(),
					tradeInstruction.getHoldPrice());
			ret.add(trade);
		}
		return ret;
	}

}
